A data processing device may include a specialized arithmetic processing unit such as an integer or floating-point processing device. An arithmetic processing unit is particularly applicable for performing tasks associated with graphics processing, digital signal processing, and scientific applications. An arithmetic processing unit generally executes instructions wherein an instruction is associated with a particular mathematical computation. For example, an arithmetic processing unit may include instructions to perform arithmetic operations such as multiplication, addition, multiplication-addition, matrix computations, and the like. An arithmetic processing unit generally represents numbers using a binary floating-point format, a binary integer format, or both. Floating point numbers and integer numbers each have an associated precision and can represent a particular range of values determined by the number of binary bits used to represent the number. An arithmetic processing unit can use saturation arithmetic to represent a result of a mathematical operation that exceeds a supported range.
Saturation arithmetic is a version of arithmetic in which the result of an arithmetic operation is limited to a fixed range between a minimum and maximum value. Furthermore, if a result of an operation is greater than the maximum value, a condition known as an overflow condition, an arithmetic processing unit provides a result corresponding to the maximum representable value. If the result of an operation is less than the minimum value, a condition known as an underflow condition, the arithmetic processing unit provides a result corresponding to the minimum representable value. The use of saturation arithmetic can reduce the severity of an error that can occur when a calculation results in either an overflow or an underflow condition. For example, without the use of saturation, an arithmetic processing unit may provide a negative-value result when a calculation overflows a supported range. Unfortunately, detecting that saturation has occurred so that the arithmetic processing unit can provide a correct saturated result can adversely affect the computational performance of the unit. This is particularly true for a multiply-add operation where the size (number of binary bits used to represent a number) of a result is limited to the same size as the multiplicand, multiplier, or the addend.
The use of the same reference symbols in different drawings indicates similar or identical items. For clarity, an identical name denotes a signal, a node for conducting the signal, and the information represented by the signal.